<?php
namespace app\serverintegralmall\service\order;
use \app\manage\service\ApiBase;
/**
 * @author:      李颖
 * @DateTime:    2017-11-01 10:30:18
 * @Description: 积分商品订单
 * 注：    增加自动操作方法： 货到用户手中，用户未点击收货，一定的时间后则进行自动收货操作
 */

class Order extends ApiBase{
	

	protected $orderLogic = '\app\serverintegralmall\logic\Order';
    protected $orderValidate = '\app\serverintegralmall\validate\Order';

    /*积分兑换商品*/
    public function integralExchange(): array 
    {
    	$data = $this->haveIssetReceiveData(['goods_id'=>0, 'user_id'=>0, 'number'=>0, 'order_code'=>' ', 'pick_up_code'=>' ', 'name'=>' ', 'phone'=>' ', 'address'=>'', 'remark'=>'']);
    	return $this->stepRun($data, 'integralExchange');
    }

    /*获取我的积分兑换订单*/
    public function integralOrderList(): array 
    {
    	$data = $this->haveIssetReceiveData(['user_id'=>0, 'page'=>1, 'listRows'=>15, 'keywords'=>'']);
    	return $this->stepRun($data, 'integralOrderList');
    }

    /*获取我的某个兑换订单详情*/
    public function integralOrderInfo(): array 
    {
    	$data = $this->haveIssetReceiveData(['user_id'=>0, 'id'=>0]);
    	return $this->stepRun($data, 'integralOrderInfo');
    }

    /*后台获取积分订单列表*/
    public function adminIntegralOrderList(): array 
    {
        $data = $this->haveIssetReceiveData(['page'=>1, 'listRows'=>15, 'keywords'=>'']);
        return $this->stepRun($data, 'adminIntegralOrderList');
    }

    /*后台获取某积分订单的详情*/
    public function adminIntegralOrderInfo(): array 
    {
        $data = $this->haveIssetReceiveData(['id'=>0]);
        return $this->stepRun($data, 'adminIntegralOrderInfo');
    }

    /*后台对某积分订单进行发货操作*/
    public function shipmentsGoods(): array 
    {
        $data = $this->haveIssetReceiveData(['id'=>0, 'logistics_company_code'=>'', 'logistics_company_name'=>' ', 'waybill_number'=>' ']);
        return $this->stepRun($data, 'shipmentsGoods');
    }

    /*我的积分订单 - 确认收货*/
    public function affirmPick(): array 
    {
        $data = $this->haveIssetReceiveData(['user_id'=>0, 'order_id'=>0]);
        return $this->stepRun($data, 'affirmPick');
    }





}